	# 
	#  Hardware port input/output functions
	#
	#  Warning: There was a bug effecting eax,ax,al, 
	#  because they aren't pushed as ebp+10 but as ebp+12.
	#  Probably because of the integral promotion... 
	#  so a whole dword is pushed into the stack?
	# 
	
.section .text


.global outb
outb:
	pushl	%ebp
	movl	%esp,%ebp

	movl	0x8(%ebp),%edx
	movl	0xc(%ebp),%eax
	outb	%al,%dx

	popl	%ebp
	ret

.global outw		
outw:
	pushl	%ebp
	movl	%esp,%ebp

	movl	0x8(%ebp),%edx
	movl	0xc(%ebp),%eax
	outw	%ax,%dx

	popl	%ebp
	ret

	
.global outl
outl:
	pushl	%ebp
	movl	%esp,%ebp

	movl	0x8(%ebp),%edx
	movl	0xc(%ebp),%eax
	outl	%eax,%dx

	popl	%ebp
	ret
	
.global inb
inb:
	pushl	%ebp
	movl	%esp,%ebp
	
	movl	0x8(%ebp),%edx
	inb	%dx,%al

	popl	%ebp
	ret


.global inw		
inw:
	pushl	%ebp
	movl	%esp,%ebp
	
	movl	0x8(%ebp),%edx
	inw	%dx,%ax

	popl	%ebp
	ret


.global inl	
inl:
	pushl	%ebp
	movl	%esp,%ebp
	
	movl	0x8(%ebp),%edx
	inl	%dx,%eax

	popl	%ebp
	ret

